﻿#include "WidgetScroll.h"
#include <QCoreApplication>


WidgetScroll::WidgetScroll(QLayout* layout, QWidget *parent)
    : QScrollArea{parent}
    , layoutInner{layout}
{
    setupUI();
}
QLayout* WidgetScroll::layout()
{
    return layoutInner;
}

void WidgetScroll::setupUI()
{
    int scollwgtCount = qApp->findChildren<WidgetScroll*>().size();
    this->setWidgetResizable(true);
    QWidget* wgt = new QWidget();
    wgt->setObjectName(QString("WidgetScroll%1").arg(scollwgtCount));
    wgt->setLayout(layoutInner);
    this->setWidget(wgt);
}
